# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'form_send_mblog.ui'
#
# Created: 三  8月 5 16:30:08 2009
#      by: The PyQt User Interface Compiler (pyuic) 3.17.1
#
# WARNING! All changes made in this file will be lost!


from qt import *
import os

class FormMblog(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

        if not name:
            self.setName("FormMblog")



        self.countLabel1 = QLabel(self,"countLabel1")
        self.countLabel1.setGeometry(QRect(20,180,82,21))

        self.sendButton1 = QPushButton(self,"sendButton1")
        self.sendButton1.setGeometry(QRect(480,170,106,37))

        self.textEdit1 = QTextEdit(self,"textEdit1")
        self.textEdit1.setGeometry(QRect(10,10,580,140))

        self.languageChange()

        self.resize(QSize(599,217).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.textEdit1,SIGNAL("textChanged()"),self.textEdit1_textChanged)
        self.connect(self.sendButton1,SIGNAL("clicked()"),self.sendButton1_clicked)


    def languageChange(self):
        self.setCaption(self.__tr("Send To MBlog"))
        self.countLabel1.setText(self.__tr("0"))
        self.sendButton1.setText(self.__tr("send"))


    def sendButton1_clicked(self):
        strx="'"+str(self.textEdit1.text().utf8().replace("'",'\'"\'"\''))+"'";
        print strx;
        os.system("./sendmblog.sh "+str(strx)+" &");
        

    def textEdit1_textChanged(self):
          self.countLabel1.setText(QString(str(self.textEdit1.text().length())));
        

    def __tr(self,s,c = None):
        return qApp.translate("FormMblog",s,c)
